home *** CD-ROM | disk | FTP | other *** search
- Subject: Memory Containers & embedding.
- Sent: 12/20/96 2:30 PM
- Received: 12/20/96 3:03 PM
- From: Paul Mylchreest, paulm@teamsoft.com
- Reply-To: ODF Interest, ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- Dear ODF Community,
-
- I have overriden FW_CEmbeddingDataInterchange::InternalizeData() to deal
- with the problem of storing parts into a database. The code below shows
- how I accomplish this by first cloning into a memory container and adding
- it to my database. This works, for I can then copy the info from the
- database into a ODFDraw document.
-
- FW_EInternalizeResult CMemContainerDataInterchange::InternalizeData(
- Environment* ev,
- FW_CContent* content,
- FW_CFrame* scopeFrame,
- ODStorageUnit* sourceSU,
- FW_StorageKinds storageKind,
- ODCloneKind cloneKind,
- ODPasteAsResult* embedAsInfo)
- {
- FW_EInternalizeResult
- result = FW_kInternalizeFailed;
-
- ObjectId
- theObjectID = 0;
-
- {
- CMemoryContainer
- memoryContainer(ev, sourceSU->GetSession(ev));
-
- if (memoryContainer.CloneFrom(ev, scopeFrame, sourceSU, cloneKind))
- {
- // Store in database.
- theObjectID = AddObject(&memoryContainer);
- result = FW_kInternalizePart;
- }
- }
-
- if (theObjectID != 0)
- {
- CMemoryContainer
- *pMemoryContainer = GetObject(ev, sourceSU->GetSession(ev),
- theObjectID);
-
- FW_ASSERT(pMemoryContainer);
-
- // Embed.
- pMemoryContainer->Open(ev);
- {
- ODDraft
- *sourceDraft = pMemoryContainer->GetDraft();
-
- FW_CAcquiredODStorageUnit
- memSU = sourceDraft->AcquireDraftProperties(ev);
-
- result = FW_CEmbeddingDataInterchange::InternalizeData(
- ev,
- content,
- scopeFrame,
- memSU,
- storageKind,
- cloneKind,
- embedAsInfo);
- }
- pMemoryContainer->Close(ev);
- }
-
- return result;
- }
-
- Now, my problems begin when I try to retrieve the previously stored part
- from the database and embedding it in my part: it is embedded allright, but
- the editor is of unknown type.
-
- How is this possible? Any comments or suggestions would be kindly
- appreciated.
-
- Thanks,
-
- ________________
- Paul Mylchreest
- Teamsoft Inc.
- Montreal, Quebec, Canada
- http://teamsoft.com
-
-
-
-